import Vue from 'vue'
// import Router from 'vue-router'
import Router from '../vuerouter/index'
import index from '@/views/index'
 
Vue.use(Router)

// export default new Router({
const  routes = [
    {
      path: '/',
      name: 'index',
      component: index
    },
    {
      path:'/detali',
      name:'detali',
      // 开启props会把url中的参数传递给组件
      // 在组件中通过props接收url传递的参数
      // props:true,
      component:() => import ('@/views/detali')
    },
    {
      path:'/login',
      name:'login',
      component:() => import('@/views/login')
    },
    {
      path:'*',
      name:'404s',
      component:() => import('@/views/404')
    }
  ]

  const router = new Router({
    mode:'history',
    routes
  })
  export default router
// })
